/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.app.model;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Thuan
 */
@Embeddable
public class ManagerOfBatchPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "managerId")
    private int managerId;
    @Basic(optional = false)
    @NotNull
    @Column(name = "batchId")
    private int batchId;
    @Basic(optional = false)
    @NotNull
    @Column(name = "semesterId")
    private int semesterId;

    public ManagerOfBatchPK() {
    }

    public ManagerOfBatchPK(int managerId, int batchId, int semesterId) {
        this.managerId = managerId;
        this.batchId = batchId;
        this.semesterId = semesterId;
    }

    public int getManagerId() {
        return managerId;
    }

    public void setManagerId(int managerId) {
        this.managerId = managerId;
    }

    public int getBatchId() {
        return batchId;
    }

    public void setBatchId(int batchId) {
        this.batchId = batchId;
    }

    public int getSemesterId() {
        return semesterId;
    }

    public void setSemesterId(int semesterId) {
        this.semesterId = semesterId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) managerId;
        hash += (int) batchId;
        hash += (int) semesterId;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ManagerOfBatchPK)) {
            return false;
        }
        ManagerOfBatchPK other = (ManagerOfBatchPK) object;
        if (this.managerId != other.managerId) {
            return false;
        }
        if (this.batchId != other.batchId) {
            return false;
        }
        if (this.semesterId != other.semesterId) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.app.model.ManagerOfBatchPK[ managerId=" + managerId + ", batchId=" + batchId + ", semesterId=" + semesterId + " ]";
    }

}
